package com.jshoperxms.controller.utils.enums;

/**
 * Created by sdywcd on 17/1/5.
 * Des:购物车枚举
 */
public class MemberCartEnums {

    /**
     * 商品在购物车的状态
     */
    public enum MemberCartStatus{
        NEWADDTOCART_ONE_NUM("新加入购物车的商品", "1"), HAVE_DELETETOCART_TWO_NUM("从购物车中删除的商品", "2"), HAVE_ADDTOORDER_THREE_NUM("被加入订单的商品", "3");
        private String name;
        private String state;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        private MemberCartStatus(String name, String state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(String tag) {
            for (MemberCartStatus d : MemberCartStatus.values()) {
                if (d.getState().equals(tag)) {
                    return d.getName();
                }
            }
            return "";
        }
    }

    /**
     * 促销来源标记
     */
    public enum MemberCartPromotionComeTag{
        FLUSH_TWO_NUM("闪购", "2"), GOODSPROMOTION_THREE_NUM("商品专题", "3"), ALBUM_FOUR_NUM("专辑商品", "4"),SECKILL_FIVE_NUM("秒杀","5"),GROUP_SIX_NUM("团购","6"),ADV_SEVEN_NUM("广告位购买","7"),SYSGIFT_EIGHT_NUM("系统赠送","8");
        private String name;
        private String state;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        private MemberCartPromotionComeTag(String name, String state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(String tag) {
            for (MemberCartPromotionComeTag d : MemberCartPromotionComeTag.values()) {
                if (d.getState().equals(tag)) {
                    return d.getName();
                }
            }
            return "";
        }
    }

    /**
     *购物车加入动作标记
     */
    public enum MemberCartActionTag{
        ADDTO_CART_ZERO_NUM("加入购物车","0"),BUY_NOW_ONE_NUM("直接购买","1"),FLUSH_TWO_NUM("闪购", "2"), GOODSPROMOTION_THREE_NUM("商品专题", "3"), ALBUM_FOUR_NUM("专辑商品", "4"),SECKILL_FIVE_NUM("秒杀","5"),GROUP_SIX_NUM("团购","6"),ADV_SEVEN_NUM("广告位购买","7"),SYSGIFT_EIGHT_NUM("系统赠送","8");
        private String name;
        private String state;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        private MemberCartActionTag(String name, String state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(String tag) {
            for (MemberCartActionTag d : MemberCartActionTag.values()) {
                if (d.getState().equals(tag)) {
                    return d.getName();
                }
            }
            return "";
        }
    }

    /**
     *是否自营
     */
    public enum MemberCartIsMall{
        SELF_ONE_NUM("自营","1"),STORE_TWO_NUM("店铺", "2");
        private String name;
        private String state;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        private MemberCartIsMall(String name, String state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(String tag) {
            for (MemberCartIsMall d : MemberCartIsMall.values()) {
                if (d.getState().equals(tag)) {
                    return d.getName();
                }
            }
            return "";
        }
    }


    /**
     *是否加入心愿单
     */
    public enum MemberCartIsWishList{
        ADD_ONE_NUM("已加入心愿单","1"),DISADD_TWO_NUM("未加入心愿单", "2");
        private String name;
        private String state;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        private MemberCartIsWishList(String name, String state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(String tag) {
            for (MemberCartIsWishList d : MemberCartIsWishList.values()) {
                if (d.getState().equals(tag)) {
                    return d.getName();
                }
            }
            return "";
        }
    }

}
